﻿@model ArivisTests.Models.TestRun
@using ArivisTests.Views;

@{
    ViewBag.Title = "Create";
    IEnumerable<SelectListItem> availablePlans = ViewBag.Plans;
    IEnumerable<SelectListItem> availableTester = ViewBag.Tester;
}

@section Navigation{
    @Html.ActionLink("Test Runs", "Index") &rsaquo; Create
}

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>TestRun</legend>

        <table class="editor-table">
            <tr>
                <td class="editor-label">
                    @Html.LabelFor(model => model.Name)
                </td>
                <td class="editor-field">
                    @Html.EditorFor(model => model.Name)
                    @Html.ValidationMessageFor(model => model.Name)
                </td>
            </tr>
            <tr>
                <td class="editor-label">
                    @Html.LabelFor(model => model.Date)
                </td>
                <td class="editor-field">
                    @Html.TextBoxFor(model => model.Date, "{0:d}")
                    @Html.ValidationMessageFor(model => model.Date)
                </td>
            </tr>
            <tr>
                <td class="editor-label">
                    @Html.LabelFor(model => model.Active)
                </td>
                <td class="editor-field">
                    @Html.EditorFor(model => model.Active)
                    @Html.ValidationMessageFor(model => model.Active)
                </td>
            </tr>
            <tr>
                <td class="editor-label">
                    Test Plan
                </td>
                <td class="editor-field">
                    @Html.DropDownList("selectedPlan", availablePlans)
                </td>
            </tr>
        </table>

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
